package com.ll.menu.user.order;

import com.droid.library.app.mvp.recycler.BaseRecyclerPresenter;
import com.ll.menu.user.app.entity.Food;
import com.ll.menu.user.cart.CartManager;

import java.util.ArrayList;

/**
 * 已点
 *
 * @author wangheng
 */

public class OrderPresenter extends BaseRecyclerPresenter<IOrderUI> {

    @Override
    protected void requestList(int page, int pageSize) {
        if(isUIDestroyed()){
            return;
        }
        ArrayList<Food> food = CartManager.getInstance().getFoodList();
        if(getUI().getAdapter() != null){
            getUI().getAdapter().resetDataList(food);
            getUI().setTotalPrice(CartManager.getInstance().getTotalPrice());

            onRefreshCompleted(PAGE_FIRST,true,true);

        }
    }
}
